3.185 \(\int \tan ^5(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=74 \[ \frac{(a-b) \tan ^4(e+f x)}{4 f}-\frac{(a-b) \tan ^2(e+f x)}{2 f}-\frac{(a-b) \log (\cos (e+f x))}{f}+\frac{b \tan ^6(e+f x)}{6 f} \]

[Out]

-(((a - b)*Log[Cos[e + f*x]])/f) - ((a - b)*Tan[e + f*x]^2)/(2*f) + ((a - b)*Tan[e + f*x]^4)/(4*f) + (b*Tan[e
+ f*x]^6)/(6*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0493532, antiderivative size = 74, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3631, 3473, 3475} \[ \frac{(a-b) \tan ^4(e+f x)}{4 f}-\frac{(a-b) \tan ^2(e+f x)}{2 f}-\frac{(a-b) \log (\cos (e+f x))}{f}+\frac{b \tan ^6(e+f x)}{6 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^5*(a + b*Tan[e + f*x]^2),x]

[Out]

-(((a - b)*Log[Cos[e + f*x]])/f) - ((a - b)*Tan[e + f*x]^2)/(2*f) + ((a - b)*Tan[e + f*x]^4)/(4*f) + (b*Tan[e
+ f*x]^6)/(6*f)

Rule 3631

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp
[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[A - C, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[
{a, b, e, f, A, C, m}, x] && NeQ[A*b^2 + a^2*C, 0] &&  !LeQ[m, -1]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \tan ^5(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{b \tan ^6(e+f x)}{6 f}+(a-b) \int \tan ^5(e+f x) \, dx\\ &=\frac{(a-b) \tan ^4(e+f x)}{4 f}+\frac{b \tan ^6(e+f x)}{6 f}+(-a+b) \int \tan ^3(e+f x) \, dx\\ &=-\frac{(a-b) \tan ^2(e+f x)}{2 f}+\frac{(a-b) \tan ^4(e+f x)}{4 f}+\frac{b \tan ^6(e+f x)}{6 f}+(a-b) \int \tan (e+f x) \, dx\\ &=-\frac{(a-b) \log (\cos (e+f x))}{f}-\frac{(a-b) \tan ^2(e+f x)}{2 f}+\frac{(a-b) \tan ^4(e+f x)}{4 f}+\frac{b \tan ^6(e+f x)}{6 f}\\ \end{align*}

Mathematica [A]  time = 0.224886, size = 63, normalized size = 0.85 \[ \frac{3 (a-b) \tan ^4(e+f x)-6 (a-b) \tan ^2(e+f x)+12 (b-a) \log (\cos (e+f x))+2 b \tan ^6(e+f x)}{12 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^5*(a + b*Tan[e + f*x]^2),x]

[Out]

(12*(-a + b)*Log[Cos[e + f*x]] - 6*(a - b)*Tan[e + f*x]^2 + 3*(a - b)*Tan[e + f*x]^4 + 2*b*Tan[e + f*x]^6)/(12
*f)

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 106, normalized size = 1.4 \begin{align*}{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{6}}{6\,f}}+{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{4}a}{4\,f}}-{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{4}}{4\,f}}-{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{2}a}{2\,f}}+{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) a}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) b}{2\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^5*(a+b*tan(f*x+e)^2),x)

[Out]

1/6*b*tan(f*x+e)^6/f+1/4/f*tan(f*x+e)^4*a-1/4*b*tan(f*x+e)^4/f-1/2/f*tan(f*x+e)^2*a+1/2*b*tan(f*x+e)^2/f+1/2/f
*ln(1+tan(f*x+e)^2)*a-1/2/f*ln(1+tan(f*x+e)^2)*b

________________________________________________________________________________________

Maxima [A]  time = 1.14392, size = 134, normalized size = 1.81 \begin{align*} -\frac{6 \,{\left (a - b\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac{6 \,{\left (2 \, a - 3 \, b\right )} \sin \left (f x + e\right )^{4} - 3 \,{\left (7 \, a - 9 \, b\right )} \sin \left (f x + e\right )^{2} + 9 \, a - 11 \, b}{\sin \left (f x + e\right )^{6} - 3 \, \sin \left (f x + e\right )^{4} + 3 \, \sin \left (f x + e\right )^{2} - 1}}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/12*(6*(a - b)*log(sin(f*x + e)^2 - 1) - (6*(2*a - 3*b)*sin(f*x + e)^4 - 3*(7*a - 9*b)*sin(f*x + e)^2 + 9*a
- 11*b)/(sin(f*x + e)^6 - 3*sin(f*x + e)^4 + 3*sin(f*x + e)^2 - 1))/f

________________________________________________________________________________________

Fricas [A]  time = 1.10308, size = 166, normalized size = 2.24 \begin{align*} \frac{2 \, b \tan \left (f x + e\right )^{6} + 3 \,{\left (a - b\right )} \tan \left (f x + e\right )^{4} - 6 \,{\left (a - b\right )} \tan \left (f x + e\right )^{2} - 6 \,{\left (a - b\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right )}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/12*(2*b*tan(f*x + e)^6 + 3*(a - b)*tan(f*x + e)^4 - 6*(a - b)*tan(f*x + e)^2 - 6*(a - b)*log(1/(tan(f*x + e)
^2 + 1)))/f

________________________________________________________________________________________

Sympy [A]  time = 0.884802, size = 116, normalized size = 1.57 \begin{align*} \begin{cases} \frac{a \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac{a \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac{b \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{b \tan ^{6}{\left (e + f x \right )}}{6 f} - \frac{b \tan ^{4}{\left (e + f x \right )}}{4 f} + \frac{b \tan ^{2}{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right ) \tan ^{5}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**5*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((a*log(tan(e + f*x)**2 + 1)/(2*f) + a*tan(e + f*x)**4/(4*f) - a*tan(e + f*x)**2/(2*f) - b*log(tan(e
+ f*x)**2 + 1)/(2*f) + b*tan(e + f*x)**6/(6*f) - b*tan(e + f*x)**4/(4*f) + b*tan(e + f*x)**2/(2*f), Ne(f, 0)),
 (x*(a + b*tan(e)**2)*tan(e)**5, True))

________________________________________________________________________________________

Giac [B]  time = 7.18547, size = 2321, normalized size = 31.36 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

-1/12*(6*a*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2
- 2*tan(f*x)*tan(e) + 1))*tan(f*x)^6*tan(e)^6 - 6*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*t
an(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^6*tan(e)^6 + 9*a*tan(f*x)^6*tan(e)
^6 - 11*b*tan(f*x)^6*tan(e)^6 - 36*a*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x
)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^5*tan(e)^5 + 36*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^
4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^5*tan(e
)^5 + 6*a*tan(f*x)^6*tan(e)^4 - 6*b*tan(f*x)^6*tan(e)^4 - 42*a*tan(f*x)^5*tan(e)^5 + 54*b*tan(f*x)^5*tan(e)^5
+ 6*a*tan(f*x)^4*tan(e)^6 - 6*b*tan(f*x)^4*tan(e)^6 + 90*a*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f
*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 - 90*b*log(4*(ta
n(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
+ 1))*tan(f*x)^4*tan(e)^4 - 3*a*tan(f*x)^6*tan(e)^2 + 3*b*tan(f*x)^6*tan(e)^2 - 36*a*tan(f*x)^5*tan(e)^3 + 36*
b*tan(f*x)^5*tan(e)^3 + 69*a*tan(f*x)^4*tan(e)^4 - 99*b*tan(f*x)^4*tan(e)^4 - 36*a*tan(f*x)^3*tan(e)^5 + 36*b*
tan(f*x)^3*tan(e)^5 - 3*a*tan(f*x)^2*tan(e)^6 + 3*b*tan(f*x)^2*tan(e)^6 - 120*a*log(4*(tan(e)^2 + 1)/(tan(f*x)
^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(
e)^3 + 120*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^
2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 - 2*b*tan(f*x)^6 + 6*a*tan(f*x)^5*tan(e) - 18*b*tan(f*x)^5*tan
(e) + 60*a*tan(f*x)^4*tan(e)^2 - 90*b*tan(f*x)^4*tan(e)^2 - 72*a*tan(f*x)^3*tan(e)^3 + 72*b*tan(f*x)^3*tan(e)^
3 + 60*a*tan(f*x)^2*tan(e)^4 - 90*b*tan(f*x)^2*tan(e)^4 + 6*a*tan(f*x)*tan(e)^5 - 18*b*tan(f*x)*tan(e)^5 - 2*b
*tan(e)^6 + 90*a*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f
*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 90*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f
*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 3*a*tan(f*x)^4
 + 3*b*tan(f*x)^4 - 36*a*tan(f*x)^3*tan(e) + 36*b*tan(f*x)^3*tan(e) + 69*a*tan(f*x)^2*tan(e)^2 - 99*b*tan(f*x)
^2*tan(e)^2 - 36*a*tan(f*x)*tan(e)^3 + 36*b*tan(f*x)*tan(e)^3 - 3*a*tan(e)^4 + 3*b*tan(e)^4 - 36*a*log(4*(tan(
e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) +
1))*tan(f*x)*tan(e) + 36*b*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)
^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 6*a*tan(f*x)^2 - 6*b*tan(f*x)^2 - 42*a*tan(f*x)*ta
n(e) + 54*b*tan(f*x)*tan(e) + 6*a*tan(e)^2 - 6*b*tan(e)^2 + 6*a*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*
tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) - 6*b*log(4*(tan(e)^2 + 1)/(tan
(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 9*a - 11
*b)/(f*tan(f*x)^6*tan(e)^6 - 6*f*tan(f*x)^5*tan(e)^5 + 15*f*tan(f*x)^4*tan(e)^4 - 20*f*tan(f*x)^3*tan(e)^3 + 1
5*f*tan(f*x)^2*tan(e)^2 - 6*f*tan(f*x)*tan(e) + f)